package com.foreknow.demo;

/**
 * 我们需要对私有属性生成相应的get/set方法
 */
public class Person {
    private String name;
    private int age;
    private String school;

    /**
     * get方法的作用:表示获取name属性的值
     * @return name
     */
    public String getName() {
        return name;
    }

    /**
     * set方法的作用：可以给Person对象的属性name赋值
     * this:表示当前对象自身(Person对象)
     * @param name
     */
    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getSchool() {
        return school;
    }

    public void setSchool(String school) {
        this.school = school;
    }

    public void eat() {
        System.out.println("eat......");
    }

    public void sleep() {
        System.out.println("sleep......");
    }


}
